package org.shop.common.until;

public class FirstToUpper {
	
	private String str;
	
	private static FirstToUpper obj;
	
	
	/**
	 */
	private FirstToUpper(String str) {
		
		this.str = str;
		
	}
	
	/**
	 * @param fileName
	 * @param className
	 * @return
	 */
	public static FirstToUpper getInstance(String fstr)
	{
		if (obj == null) {
			synchronized (FirstToUpper.class){
                if(obj == null){
                	obj = new FirstToUpper(fstr);
                }
			}
		} else {
			obj.setStr(fstr);
		}
		
		return obj;
	}
	
	
	public String upperCase() {  
	    char[] ch = this.str.toCharArray();  
	    if (ch[0] >= 'a' && ch[0] <= 'z') {  
	        ch[0] = (char) (ch[0] - 32);  
	    }  
	    return new String(ch);  
	}

	public String getStr() {
		return str;
	}

	public void setStr(String str) {
		this.str = str;
	} 
	
	
}
